package com.origin.uilibrary.activity

import android.content.Intent
import android.graphics.Color
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import com.origin.uilibrary.R
import com.origin.uilibrary.SelectorFactory
import com.origin.uilibrary.pullrefreshview.page.activities.PullPageActivity
import com.origin.utils.log.LogUtils
import kotlinx.android.synthetic.main.activity_ui.*
import java.util.*

class UiActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_ui)
    }

    fun toPullPage(view: View) {
        startActivity(Intent(this, PullPageActivity::class.java))
    }

    var progressPre=0
    fun activeDownLoad(view: View){
        LogUtils.e("activeDownLoad  ","xx")
        Timer().schedule(object : TimerTask() {
            override fun run() {
                //需要执行的任务
                LogUtils.e("activeDownLoad  ","xx")
                progressPre++;
                btn_down_load_progress.progress=progressPre;
                if(progressPre>=100){
                    cancel()
                }
            }
        }, 0,500)
    }
}